<script lang="ts" setup>
import { reactive, ref } from 'vue'
const props = defineProps(['dialogFormVisible'])
const emit = defineEmits(['handleDialogOpen', 'addCurb'])
const formInline = reactive({
    id: 10,
    date: '0000-05-03',
    name: 'aaa',
    address: '-----------',
})



const addCurb = () => {
    emit('handleDialogOpen', false)
    emit('addCurb', formInline)
}

</script>

<template>
    <el-dialog :inline="true" v-model="props.dialogFormVisible" title="新增车场配置" width="500"
        @close="emit('handleDialogOpen', false)" destroy-on-close="true" style="width:50%">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="Approved by">
                <el-input v-model="formInline.name" placeholder="Approved by" clearable />
            </el-form-item>
            <el-form-item label="Activity zone">
                <el-select v-model="formInline.address" placeholder="Activity zone" clearable>
                    <el-option label="Zone one" value="shanghai" />
                    <el-option label="Zone two" value="beijing" />
                </el-select>
            </el-form-item>
            <el-form-item label="Activity time">
                <el-date-picker v-model="formInline.date" type="date" placeholder="Pick a date" clearable />
            </el-form-item>
        </el-form>
        <template #footer>
            <div class="dialog-footer">
                <el-button @click="$emit('handleDialogOpen', false)">取消</el-button>
                <el-button type="primary" @click="addCurb">
                    保存
                </el-button>
            </div>
        </template>
    </el-dialog>
</template>

<style lang='scss' scoped></style>